/*
 * @Author: wei_jt@ecidi.com
 * @Date: 2019-11-07 09:36:15
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-09-02 10:39:52
 * @Description: 权限模块接口
 */
import request from '@/utils/request'

/** 删除功能权限 */
export function deleteButton (id) {
  return request({
    url: '/sys-system/button',
    method: 'DELETE',
    params: {
      id
    }
  })
}


/** 获取功能权限列表 */
export function getButtonPage (params) {
  return request({
    url: '/sys-system/menu/buttons/page',
    method: 'get',
    params: {
      ...params
    }
  })
}

/** 新建功能权限 */
export function addButton (data) {
  return request({
    url: '/sys-system/button',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/** 更新功能权限 */
export function saveButton (data) {
  return request({
    url: '/sys-system/button',
    method: 'PUT',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/** 删除数据权限 */
export function deleteDataScope (id) {
  return request({
    url: '/sys-system/dataScope',
    method: 'DELETE',
    params: {
      id
    }
  })
}

/** 获取菜单树 */
export function getMenusTree (params) {
  return request({
    url: '/sys-system/menus/tree',
    method: 'get',
    params: params
  })
}
/**导出功能权限 */
export function exportButton (data) {
  return request({
    url: '/sys-system/buttons/export',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
/**导入功能权限 */
export function importButton (data) {
  return request({
    url: '/sys-system/buttons/import',
    method: 'post',
    data: data
  })
}